﻿<!--XAML for NumericUpDown that inherits from UserControl.-->
<UserControl x:Class="MLifterSettingsManager.NumericUpDown"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MLifterSettingsManager">
    <Grid Margin="3">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="34*" />
            <ColumnDefinition Width="18*" />
        </Grid.ColumnDefinitions>

        <Border BorderThickness="1" BorderBrush="Gray" Margin="2" 
                Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Stretch">

            <!--Bind the TextBlock to the Value property-->
            <TextBlock 
                Width="Auto" TextAlignment="Right" Padding="2"
                Text="{Binding RelativeSource={RelativeSource FindAncestor, 
                               AncestorType={x:Type local:NumericUpDown}}, 
                               Path=Value}"/>

        </Border>

        <RepeatButton Name="upButton" Click="upButton_Click" 
                      Grid.Column="1" Grid.Row="0" FontFamily="Symbol" FontSize="6" Width="14" Height="16" VerticalContentAlignment="Top" HorizontalContentAlignment="Center">Ù</RepeatButton>

        <RepeatButton Name="downButton" Click="downButton_Click" 
                      Grid.Column="1" Grid.Row="1" FontFamily="Symbol" FontSize="6" Width="14" Height="16" VerticalContentAlignment="Top" HorizontalContentAlignment="Center">Ú</RepeatButton>

    </Grid>
</UserControl>

